package com.eaoa.vo.pub;

import com.eaoa.vo.pub.base.BasePubAddress;
import com.stony.core.util.CoreUtils;
import com.stony.core.util.LabelValue;

/**
 * 
 * @author zhenglun.zhou
 *
 */
public class PubAddress extends BasePubAddress implements LabelValue, Comparable{

	// Fields

	private static final long serialVersionUID = 1L;

	// Constructors

	/** default constructor */
	public PubAddress() {
		super();
	}

	/** minimal constructor */
	public PubAddress(Long addressno) {
		super(addressno);
	}

	public int compareTo(Object o) {
		int result = 0;
		PubAddress obj1 = this;
		PubAddress obj2 = (PubAddress)o;
		if(obj1.getAdcode()!=null && obj2.getAdcode()!=null){
			result = obj1.getAdcode().compareTo(obj2.getAdcode());
		}
		return result;
	}

	public String getLabel() {
		return 	getAdcode()+"-"+getAdname();
	}

	public String getLabelshort() {
		return getAdname();
	}

	public String getValue() {
		return CoreUtils.formatString(getAddressno());
	}
}